package com.lcc.lynx.base.system.pojo.dv;

import com.lcc.lynx.common.ITree;
import com.lcc.lynx.base.system.pojo.SysMenu;
import lombok.Data;

import java.util.Arrays;
import java.util.List;


/** 
 * 系统菜单参数实体
 * @auth lcc
 * @date 2024-12-09
 */
@Data
public class SysMenuDV extends SysMenu implements ITree {

    @Override
    public Object getId() {
        return getMenuId();
    }

    @Override
    public String getLabel() {
        return getName();
    }

    private List<SysMenuDV> children;

    public void setOrderBy(String orderBy) {
        if("sort".equals(orderBy)){
            put("orderByInList", Arrays.asList("pid", "sort"));
        }
    }

    public void setPidInList(List<Long> list) {
        put("pidInList", list);
    }
}